<?php 

$id = $_GET['id'];

$data = $_POST;

$data['ctime'] = time();

//读取老数据 
$old = file_get_contents('./Db/msg.txt');
//转数组
$old = json_decode($old,true);

$old[$id] = $data;

//写到数据库
file_put_contents('./Db/msg.txt', json_encode($old));

// 跳转到首页
header("Location:./index.php");









 ?>